#ifndef	_MYADO_H_H
#define	_MYADO_H_H

#pragma warning (disable: 4146)
#import "C:\Program Files\Common Files\System\ado\msadox.dll" 
#import "C:\Program Files\Common Files\System\ado\msado15.dll"	no_namespace rename("EOF", "EndOfFile")

#pragma warning (disable: 4146)

#define TESTHR(x) if FAILED(x) _com_issue_error(x)


class MyAdo
{
public:
	MyAdo();
	MyAdo(const char * path);
	MyAdo(const MyAdo&);
	~MyAdo();
	void	CreateDataBase(const char * path = NULL);
	void	CreateTable(const char * path = NULL);
	void ExecuteCommand(_CommandPtr pCmdTemp, _RecordsetPtr pRstTemp);
public:
	void	addData();
	void	deleteData();
	void	readData();
	void	amendData();
private:
	const char*			filePath;
	HRESULT				hr;
	ADOX::_CatalogPtr	m_pCatalog;
	_ConnectionPtr		m_Conn;
	_RecordsetPtr		m_Rset;
	_CommandPtr			m_Comm;
	static const char*	connStr;
	char *				strCnn;
};


#endif